/*
 * TeacherInsuranceValidatorTests.cpp
 *
 *  Created on: 01 Ιουν 2010
 *      Author: Sartios
 */

#include "InsuranceValidatorTests.h"
#include "../../../Validators/TeacherValidators/TeacherInsuranceNumberValidator/InsuranceNumberValidator.h"

namespace Teacher{

void	InsuranceValidatorTests::setUp(){
	validator_= new Teacher::InsuranceNumberValidator();
}

void	InsuranceValidatorTests::tearDown(){
	delete validator_;
	validator_=NULL;
}

void	InsuranceValidatorTests::insuranceNumberLengthIsAppropriate_NumberSmallerThan4_ReturnFalse(){
	string *threeDigits=new string("012");
	bool result = validator_->insuranceNumberLengthIsAppropriate(threeDigits);
	delete threeDigits;
	CPPUNIT_ASSERT_MESSAGE("Validator should return false in <4 condition",(false==result));
}

void	InsuranceValidatorTests::insuranceNumberLengthIsAppropriate_NumberBiggerThan15_ReturnFalse(){
	string *sixteenDigits = new string("0123456789101213");
	bool result = validator_->insuranceNumberLengthIsAppropriate(sixteenDigits);
	delete sixteenDigits;
	CPPUNIT_ASSERT_MESSAGE("Validator should return false in >16 condition",(false==result));
}

void	InsuranceValidatorTests::insuranceNumberLengthIsAppropriate_NumberBetween4And15_ReturnTrue(){
	string *six = new string("012345");
	bool result = validator_->insuranceNumberLengthIsAppropriate(six);
	delete six;
	CPPUNIT_ASSERT_MESSAGE("Validator should return false in 3< and >16 condition",(true==result));
}

}
